package com.xcesys.extras.remoting.system.impl;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xcesys.extras.core.service.ICrudService;
import com.xcesys.extras.dataobject.system.Category;
import com.xcesys.extras.master.service.TmCategoryService;
import com.xcesys.extras.model.TmCategory;
import com.xcesys.extras.remoting.BaseRemotingServiceCrudImpl;
import com.xcesys.extras.remoting.system.RCategoryService;

@Service("RCategoryService")
public class RCategoryServiceImpl extends
		BaseRemotingServiceCrudImpl<Category, TmCategory> implements
		RCategoryService {

	@Autowired
	private TmCategoryService service;

	@Override
	public Collection<Category> findAllLevelChildren(Long parentId) {
		return fromModel(service.findAllLevelChildren(parentId));
	}

	@Override
	public Collection<Category> findChildren(Long parentId) {
		return fromModel(service.findChildren(parentId));
	}

	@Override
	protected ICrudService<TmCategory> getCrudService() {
		return service;
	}

}
